Skip to content

feat: Add region property to ModelConfig#201

Merged
andrewklatzke merged 2 commits into
mainfrom
aklatzke/AIC-2689/add-region-python
Jun 5, 2026
Merged

feat: Add region property to ModelConfig#201
andrewklatzke merged 2 commits into
mainfrom
aklatzke/AIC-2689/add-region-python

Conversation

@andrewklatzke
Copy link
Copy Markdown
Contributor

@andrewklatzke andrewklatzke commented Jun 5, 2026

BEGIN_COMMIT_OVERRIDE
feat: Add region property to ModelConfig
END_COMMIT_OVERRIDE

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

https://launchdarkly.atlassian.net/jira/software/c/projects/AIC/boards/2045?selectedIssue=AIC-2689

Describe the solution you've provided

Adds the region property to the ModelConfig object

Additional context

Some model providers, namely Bedrock, require including a region field on a given call. A call for a sonnet model might look like: global.anthropic.sonnet-4-7 or us.anthropic.sonnet-4-7 etc.

This field was added on the UI for Bedrock models and is optionally includable. Users would be expected to prepend their region to their model names if they're using a provider that requires it.


Note

Low Risk
Backward-compatible optional field on model config parsing with no changes to auth or provider call paths in this diff.

Overview
Adds optional region on ModelConfig so AI Config flag variations can carry deployment region (e.g. Bedrock us vs global) without encoding it only in the model name.

LDAIClient now reads model.region from evaluated variations when building completion/agent/judge configs, and to_dict() includes region for round-tripping. Omitted region stays None, so existing flags behave unchanged.

Reviewed by Cursor Bugbot for commit 219f71b. Bugbot is set up for automated code reviews on this repo. Configure here.

@andrewklatzke andrewklatzke requested a review from a team as a code owner June 5, 2026 19:19
@andrewklatzke andrewklatzke requested a review from jsonbailey June 5, 2026 19:19
@jsonbailey jsonbailey changed the title feat: adds region property to ModelConfig feat: Add region property to ModelConfig Jun 5, 2026
"""

def __init__(self, name: str, parameters: Optional[Dict[str, Any]] = None, custom: Optional[Dict[str, Any]] = None):
def __init__(self, name: str, parameters: Optional[Dict[str, Any]] = None, custom: Optional[Dict[str, Any]] = None, region: Optional[str] = None):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like a lint issue with the length of this line.

@andrewklatzke andrewklatzke merged commit 45707b6 into main Jun 5, 2026
46 checks passed
@andrewklatzke andrewklatzke deleted the aklatzke/AIC-2689/add-region-python branch June 5, 2026 21:12
@github-actions github-actions Bot mentioned this pull request Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants